package com.robot.base.common.api;

import com.qihang.annotations.ApiFactory;
import com.robot.base.model.CollectDetailBean;
import com.robot.base.model.CommentBean;
import com.robot.base.model.CourseAllTypeBean;
import com.robot.base.model.PageListBean;
import com.robot.base.model.WorksBean;
import com.robot.base.model.WorksHomeBean;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.http.BaseResponse;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

@ApiFactory(value = GlBaseApi.class)
public interface WorkService {

    @GET("/app-api/app/works/homeData")
    Observable<BaseResponse<WorksHomeBean>> homeData();

    @GET("/app-api/app/works/getWorkDetail")
    Observable<BaseResponse<WorksBean>> getWorkDetail(@Query("id") String id);

    @GET("/app-api/app/works/allType")
    Observable<BaseResponse<List<CourseAllTypeBean>>> allType();

    @GET("/app-api/app/works/page")
    Observable<BaseResponse<PageListBean<WorksBean>>> page(@QueryMap Map<String, Object> map);

    //新增作品接口
    @POST("/app-api/app/works/createWorks")
    Observable<BaseResponse<String>> createWorks(@Body Map<String, Object> map);

    //创建收藏夹
    @POST("/app-api/app/works/createCollect")
    Observable<BaseResponse<String>> createCollect(@Body Map<String, Object> map);

    //关注收藏夹作品
    @POST("/app-api/app/works/followCollect")
    Observable<BaseResponse<String>> followCollect(@Body Map<String, Object> map);

    //获得收藏夹信息
    @GET("/app-api/app/works/getCollectDetail")
    Observable<BaseResponse<CollectDetailBean>> getCollectDetail(@Query("id") String id);

    //分页获取收藏夹列表
    @GET("/app-api/app/works/collect-follow-page")
    Observable<BaseResponse<PageListBean<CollectDetailBean>>> collectPage(@QueryMap Map<String, Object> map);

    //添加收藏夹作品
    @POST("/app-api/app/works/saveCollectWorks")
    Observable<BaseResponse<String>> saveCollectWorks(@Body Map<String, Object> map);

    //热门收藏夹
    @POST("/app-api/app/works/hotCollect")
    Observable<BaseResponse<List<CollectDetailBean>>> hotCollect(@Body Map<String, Object> map);

    //点赞或分享作品接口
    @POST("/app-api/app/works/likeWork")
    Observable<BaseResponse<String>> likeWork(@Body Map<String, Object> map);

    //获取作品评价接口
    @GET("/app-api/app/works/getWorkComment")
    Observable<BaseResponse<List<CommentBean>>> getWorkComment(@Query("id") String id);

    //评价作品
    @POST("/app-api/app/works/createWorkComment")
    Observable<BaseResponse<String>> createWorkComment(@Body Map<String, Object> map);

    //分页获取作品评价
    @GET("/app-api/app/works/pageComment")
    Observable<BaseResponse<PageListBean<CommentBean>>> pageComment(@QueryMap Map<String, Object> map);
}
